﻿
IF  EXISTS (SELECT * FROM sys.objects WHERE object_id = OBJECT_ID(N'[dbo].[sproc_DeleteStaffFromTeam]') AND type in (N'P', N'PC'))
    DROP PROCEDURE [dbo].[sproc_DeleteStaffFromTeam];
GO
CREATE PROCEDURE [dbo].[sproc_DeleteStaffFromTeam]
    @TeamID int,
    @StaffIDS nvarchar(3000)
/*
=====================================================
功能:    删除组成员
参数:
    @TeamID int            :    员工所在组
    @StaffIDS nvarchar(3000)    :    成员ID集合

=====================================================
*/
AS
DECLARE @SQL nvarchar(4000)
SET @SQL = 'DELETE FROM uds_staff_in_team WHERE staff_id in (' + @StaffIDS + ') and team_id = ' + convert(nvarchar,@teamid)
EXEC (@SQL)